/************************************************************
 * Copyright (C), 2022-2030, ripnano. Co., Ltd.
 * FileName:        form_extract_debug.h
 * Author:          Dan Yin
 * Date:            2024-07-15
 * Description:     the class of extract/pcr view window
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_VIEW_PROCEDURE_H
#define FORM_VIEW_PROCEDURE_H

// add necessary includes here
#include "ui/defines/global.h"

struct ST_PROCESS_PARAMS;
class ExtractTableView;

namespace Ui {
class FormViewProcedure;
}

class FormViewProcedure : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormViewProcedure" class, if exist, return it
    static FormViewProcedure* getInstance(QWidget *pParent = nullptr);

    // The default destructor
    virtual ~FormViewProcedure();

    // Show window & initialize data
    void displayWindow(int nProcedureType, int nProcedureId);

signals:
    // The signal that refresh UI info
    void signalRefreshUI();

    // Confirm to do it
    void signalReplayInfo(int nReplyType, bool bAccepted, QVariant varProcessParams);

private slots:
    void on_pushButton_Cancel_clicked();

    // The slot that refresh UI info
    void slotRefreshUI();

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

private:
    // The default constructor
    explicit FormViewProcedure(QWidget *parent = nullptr);

    // After constructing object, initialize the object
    void _initialze();

    // Init the window style
    void _initUi();

    // Refresh the list view data
    void _refreshListView();

private:
    Ui::FormViewProcedure *ui;
    int                 m_nProcedureType = E_PT_EXTRACT;
    int                 m_nProcedureId = 0;

    QThread             m_thrTableViewWorker;
    ExtractTableView    *m_pMyTableView = nullptr;
};

#endif // FORM_VIEW_PROCEDURE_H
